using System;
using Genko.Model.Schema;

namespace Genko.Model
{
	public class MemberAttribute
	{
		protected Member owner = null;
		protected string name = null;
		
		protected internal MemberAttribute()
		{
		
		}

		protected internal MemberAttribute(Member owner, string name)
		{
			this.owner = owner;
			this.name = name;
		}
		
		public virtual Member Owner
		{
			get { return this.owner; }
		}
		
		public virtual string Name
		{
			get { return this.name; }
		}
		
		public virtual DataType Type
		{
			get { return this.Owner.GetAttributeType(this.Name); }
		}
		
		public virtual string Value
		{
			get {
				return this.Owner.GetAttribute(this.Name);
			}
			set {
				this.Owner.SetAttribute(this.Name, value);
			}
		}
	}
}
